import App from './App'

// #ifndef VUE3
import Vue from 'vue'
import uView from 'uview-ui';
import {myRequest} from "./service/http.js"
Vue.use(uView);

Vue.prototype.$http=myRequest
Vue.filter("FormatTime",function(originVal){
		const dt = new Date(originVal)
		const y = dt.getFullYear()
		const m = (dt.getMonth() + 1 + '').padStart(2, '0')
		const d = (dt.getDate() + '').padStart(2, '0')
		const hh = (dt.getHours() + '').padStart(2, '0')
		const mm = (dt.getMinutes() + '').padStart(2, '0')
		// const ss = (dt.getSeconds() + '').padStart(2, '0')
		return `${y}-${m}-${d} ${hh}:${mm}`
})
uni.getSystemInfo({
	success:function(e){
			Vue.prototype.statusBar = e.statusBarHeight
			// #ifndef MP
			if(e.platform == 'android') {
				Vue.prototype.customBar = e.statusBarHeight + 50
			}else {
			    Vue.prototype.customBar = e.statusBarHeight + 45
			}
			// #endif
			            
			// #ifdef MP-WEIXIN
			let custom = wx.getMenuButtonBoundingClientRect()
			Vue.prototype.customBar = custom.bottom + custom.top - e.statusBarHeight
			// #endif
			            
			// #ifdef MP-ALIPAY
			Vue.prototype.customBar = e.statusBarHeight + e.titleBarHeight
			// #endif
	}
})
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
    ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif